<?php
//图片上传方法
function upload(){
    $upload=new \Think\Upload();
        $upload->maxSize=5*1024*1024;
        $upload->autosub=true;
        $upload->saveName=array('uniqid','');
        $upload->exts=array('jpg','gif','png','jpeg');
        $upload->rootPath='./Public/image/';
        $upload->savePath = ''; 
        $upload->subName=array('date','Ymd');
        $info=$upload->upload();
    return $info;
}
?>